﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AMPLibrary
{
    public class SplittedArrayList : ArrayList
    {
        public SplittedArrayList()
        {
            this.Clear();
        }

        public SplittedArrayList(string inputString)
        {
            string[] paths = inputString.Split('|');

            foreach (string path in paths)
            {
                string pathToAdd = path.Trim();

                if (pathToAdd != string.Empty)
                    this.Add(pathToAdd);
            }
        }

        public override string ToString()
        {
            string output = string.Empty;

            foreach (string folder in this)
                output += folder + " |";

            if(output.EndsWith("|"))
                output = output.Remove(output.Length - 1);

            return output.Trim();
        }
    }
}
